const mongoose = require("mongoose");
//创建管理员列表集合的约束对象，代表后端要把哪些数据存入数据库中
const advSchema = mongoose.Schema({
  advTitle: {//标题
    type: String,
    required: true,
  },
  advType: {//类型
    type: String,
    required: true
  },
  advOrder: {//顺序
    type: String,
    required: true
  },
  advHref: {//图片路径
    type: String,
    require: true
  },
  addTime: {//添加时间
    type: String,
    require: true
  },
 updateTime: {
    type: String,
    require: true,
    default: '---'
  },
})

//根据这个约束对象创建一个管理员列表的集合
const advModel = mongoose.model("advList", advSchema);//advList是数据库中集合的名字

module.exports = advModel;